(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
rev,
rev1,
rev2They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(6) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev1, rev, rev2
They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
rev1(
hole_rev12_0,
gen_nil:++3_0(
n5_0)) →
hole_rev12_0, rt ∈ Ω(1 + n5
0)
Induction Base:
rev1(hole_rev12_0, gen_nil:++3_0(0)) →RΩ(1)
hole_rev12_0
Induction Step:
rev1(hole_rev12_0, gen_nil:++3_0(+(n5_0, 1))) →RΩ(1)
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) →IH
hole_rev12_0
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev2, rev
They will be analysed ascendingly in the following order:
rev = rev2
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
rev2(
hole_rev12_0,
gen_nil:++3_0(
+(
1,
n128_0))) →
*4_0, rt ∈ Ω(n128
0)
Induction Base:
rev2(hole_rev12_0, gen_nil:++3_0(+(1, 0)))
Induction Step:
rev2(hole_rev12_0, gen_nil:++3_0(+(1, +(n128_0, 1)))) →RΩ(1)
rev(++(hole_rev12_0, rev(rev2(hole_rev12_0, gen_nil:++3_0(+(1, n128_0)))))) →IH
rev(++(hole_rev12_0, rev(*4_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
rev2(hole_rev12_0, gen_nil:++3_0(+(1, n128_0))) → *4_0, rt ∈ Ω(n1280)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev
They will be analysed ascendingly in the following order:
rev = rev2
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol rev.
(14) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
rev2(hole_rev12_0, gen_nil:++3_0(+(1, n128_0))) → *4_0, rt ∈ Ω(n1280)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
(16) BOUNDS(n^1, INF)
(17) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
rev2(hole_rev12_0, gen_nil:++3_0(+(1, n128_0))) → *4_0, rt ∈ Ω(n1280)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
(19) BOUNDS(n^1, INF)
(20) Obligation:
Innermost TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
(22) BOUNDS(n^1, INF)